package com.pw.study.core

import com.pw.study.utils.SparkUtils
import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD

/**
 * @Desc: 单词统计
 * @author: future
 * @since: 2022/6/13-20:44
 */
object WordCountJob {
  private val appName: String = "WordCountJob"

  def main(args: Array[String]): Unit = {
    val spark: SparkContext = SparkUtils.getEnv(appName)
    val rdd: RDD[String] = spark.textFile("data/file/words.txt")
    rdd.foreach(println(_))
    spark.stop()

  }
}
